package com.ruoyi.pay.config;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000142633539";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCoONn7XWTmBsReHEyNR7t35Aw0AqtrMfknMZowJXrTgOMcGnwROnj3cpNnaTunLQVecYMLgmRIugCUzHE+a/O1j20LkGS4iImKSFOevPFzV1ezjaPTfUPLm6GGQ7NEz0+AtMpMWaR5ha91j3T/R6BAhESgsX6E7WJ/6hhfXmqnwo7M2TJpLkilmE+1fp9Cj8YvN9QLXHvW75yIlaDFc2hnpHXFTQmjBTXaR+ZOU0DN0RjudlWMXNlt82RKbPtc9OPKeclt8d8X3kYONY6I8fmalmPNrDAyn4LAZLO2OA4EIbPhcCeVSQF4S6HYqPucjfjRJCkb9F00UNiG5c3ovgf/AgMBAAECggEAcsH10oiv4EwVga4EewzIUs17la+MiSAaPCaWbOnklIyEYhOfN5GQHB5JeG5Nh4oq83a0UxGsoABjjR660j6Kjv09AnqKe2iJi5Azm0KB5JFc/txNOmVl7mxJEHL2xKY4MjEjIFq23T/ZpnUq90tBg0G4H3d2O/BFFcX4wnaCg9YTK8EhpcIVPPdCLR+lgHGjEU0foG4kWX+V6NtMvc1j5cn9EbGRl6MzoUMeKirPcrqWhDPS7k9sJkouPhEuGZAB/yeH5k/ewrPPUosh175XozZ/dbab0zuu4Q6szjVUOHAagvLGGGczqfunqe0lOSIddnJECienU2wh1ZqBzjGM4QKBgQDzG7Gd5BUXeXyhHWgObB4yND/I2a4beOztZzmeoGH/jkO2fBQ51qMK/YAuYHn4JP9sRP3cfi+U4+GfGChPatLcYzFCPrH1dxAczEBfFpre4pvLvhNqxTO6E/3rYEICUlaLw3qwV+VznfHlqcxvIjrOqhDlqN2gCVn/+JkaDALz2wKBgQCxJItMAvs3XKOlaEbVLuePbbHiBr+kR7mfh7A3x7LIXT/XJ2xTycpuczL1iLLFzI+Q3P3ZTzYSXo+gLonFyfhG8cawj9aAXmQx4Qk/R6VTX+xJVorEl6LhFcZUABqh9W2B7gNW+Pd4CpczUlADeZKj4pfjKHIkGsBNyts3PJDHrQKBgCmc6fBO5FVaVDz33aHqW9jYHLryl9zX/CY+7xv59Axce7a20nd8B/iPn+tQVFBndNlBjfq6FsbzouEqr2u4q1NSH1JpjOipcrabN8GPCv9v5p8fcA9spggJ+ALcPTBMi8fstAmPYhVCSe+3+uhjAZHyhmXpW9ZTA3bPRNWyjKbVAoGAPQFi35ifP5+t1Acnbb+ri5+xhS/hzAfPi3tFWtBxZ8OFeuleyzRRfNw7joe3WZtrTe5tletLqePa/sVIOU+nK3eUf7Xpn2fihbMEZkCcVSxRyaf+Ploig/XlyYQHqANH5Vk82TUAtNyg2dHdMHUr5TjiKh8BwCFeXOwhttIq4jkCgYEA0TSgl/6VYstc4M5XBLRPTfdRLjX3LuGLpc+61k6QhIm+KGn1ulWwr9CnpFJTPmqgQYnKEMxCTM2XKGmphR3FR9eUPfWupahB6ZszO/f7YsB37mVRTN11TrvGZby7ARYbrYChfvQcp76kjwWGhfqtM17TO7vqBztQShNkPWIT8E8=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlPcYcW+iftdJFO3vRUFJQX6dkNtnwjevyvaj/hKGXmiGxICJuSYjRWZagJuP/FGaxPnsFH3LCAtDsY268RVPwjOhhF8fZtdGQRO0bZH9RkeWW3a45CXhGRs8lE+PhkfYdekQh1rovWD2ho0lMNotPSUE0apSxljm1aAqMGlzHR1dgHTUiHvBwDcOTpKHZFYZfdOtbrdCs/+8mceVC9NJ+bKYbWuZa8Exj1OoWK8OAd1QBKeJ7i8t4BDG0eLmXJWNpKujA4T1r57bWK4jWo81yorfMvQ4kN6PGJ7pZmuETXevr1LgpPW7m7f/RvSa0XvPD0ogGQSbHBfJOFNftNIvjwIDAQAB";

    // TODO 用来接收支付结果（异步回调路径）
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    public static String notify_url = "http://localhost:9302/alipay/result";

    // TODO 支付完成之后的跳转路径（同步回调路径）
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    // public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    public static String return_url = "http://localhost/paysuccess.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
